using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections.Generic;
using System.Collections;
using WEB.DAL.DBManagers;
using log4net;
using WEB.Exceptions;
using WEB.BLL.Entities;
namespace WEB.BLL.Services
{
	#region ICvService

	/// <summary>
	/// Cv_Service object for Ibatis mapped table 'Cv'.
	/// </summary>
	public class ICvService : BaseSqlMapDao{
		private static readonly ILog log = LogManager.GetLogger(typeof(BaseSqlMapDao).Name);
	
		public IList<CvEntity> LoadData()
        {
            try
            {
                return ExecuteQueryForList<CvEntity>("CvLoadAll", null);
            }
          catch (Exception ex)
            {
                log.Debug(ex.Message);
                throw new DBException(ex.Message, ex);
            }
        }
       public CvEntity LoadByPrimaryKey(CvEntity objE)
        {
            try
            {
                return ExecuteQueryForObject<CvEntity>("CvLoadByPrimaryKey", objE);
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                throw new DBException(ex.Message, ex);
            }
        }
        
        /// <summary>
        /// add new Cv to DB 
        /// </summary>
        /// <param name="objE"></param>
        /// <returns></returns>
        public int Insert(CvEntity objE)
        {
            try
            {
                ExecuteInsert("CvInsert", objE);
                return 1;
            }
           catch (Exception ex)
            {
                log.Debug(ex.Message);
                throw new DBException(ex.Message, ex);
            }
        }
        /// <summary>
        /// update Cv to DB 
        /// </summary>
        /// <param name="objE"></param>
        /// <returns></returns>
        public int Update(CvEntity objE)
        {
            try
            {
                ExecuteUpdate("CvUpdate", objE);
                return 1;
            }
           catch (Exception ex)
            {
                log.Debug(ex.Message);
                throw new DBException(ex.Message, ex);
            }
        }
        /// <summary>
        /// delete Cv to DB 
        /// </summary>
        /// <param name="objE"></param>
        /// <returns></returns>
        public int Delete(CvEntity objE)
        {
            try
            {
                ExecuteDelete("CvDelete", objE);
                return 1;
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                throw new DBException(ex.Message, ex);
            }
        }
	}
	#endregion  
}
